<form action="<?php echo BASE_URL;?>/test/createdoc" method="post" id="export-doc-form">
<input type="hidden" name="html_submit" id="html_submit">
	<div id="rightCol" >
		<div class="name-page-cms"><p style="text-align: center;font-weight: 600;font-size: 18px;">TRƯỜNG ĐẠI HỌC CÔNG NGHỆ THÔNG TIN</p><br/>
			<p style="text-align: center;font-weight: 600;font-size: 18px;">KHOA HỆ THỐNG THÔNG TIN </p>
		</div>
	</div>
<div id="html-export-doc">
<?php
$html = '';
$html .='<div class="header-test-print">';
$html .='	<table style="text-align: center;">';
$html .='		<tr>';
$html .='			<td style="text-align: center; font-weight: 700;"><b>TRƯỜNG ĐẠI HỌC CÔNG NGHỆ THÔNG TIN <br/> KHOA HỆ THỐNG THÔNG TIN</b></td>';
$html .='		</tr>';
$html .='		<tr>';
$html .='			<td><p align="center"><hr style="width: 180px;"></p></td>';
$html .='		</tr>';
$html .='		<tr>';
$html .='			<td style="font-weight: 600;" ><b>'. $this->data['obj_test']['title'] .'</b></td>';
$html .='		</tr>';
$html .='		<tr>';
$html .='			<td style="font-weight: 600;"><b>MÔN: '.$this->data['obj_subject']['full_name'].'</b></td>';
$html .='		</tr>';
$html .='		<tr>';
$html .='			<td style="font-weight: 400;">Lớp: </td>';
$html .='		</tr>';
$html .='		<tr>';
$html .='			<td style="font-weight: 400;">Thời gian làm bài: '.$this->data['obj_test']['duration_test'].' phút. </td>';
$html .='		</tr>';
$html .='	</table>';
$html .='</div>';

	if(!empty($this->data["testID"])){
			$list_questionID 	= $this->data['question_id'];// danh sách id của câu hỏi
			$list_score    		= $this->data['question_score'];// điểm làm bài của user
			$questionPerPage	= $this->data["question_perpage"];
			$answer_of_user 	= $this->data['question']; // các câu trả lời của user
			$list_score_in_test_table	= $this->data["list_score_in_test_table"];// Điểm của câu hỏi được set trong bài test
			$questionPerPage 	= $questionPerPage==0? 1:$questionPerPage;
			$totalQuestion		= count($list_questionID);
			$totalPage			= (int)($totalQuestion/$questionPerPage);
			$totalPage			= $totalQuestion%$questionPerPage==0?$totalPage:($totalPage+1) ;
			//$html .= "<hr/>";
			//$htmlContentQuestion = '';
			if(!empty($list_questionID[0])){		
					foreach($list_questionID as $key=>$list_questionIDItem){ 
							//echo  $this->viewQuestion($this->data["testID"],$list_questionIDItem,"Câu ".($key+1)." : ",$answer_of_user[$list_questionIDItem],0,0,0,1,-1,$list_score[$key], $list_score_in_test_table[$key] );
							// Begin Lấy đường dẫn tuyệt đối cho hình ảnh
							$HTML = $this->viewQuestionExportDoc($this->data["testID"],trim($list_questionIDItem),"Câu ".($key+1)." : ",$answer_of_user[$list_questionIDItem],$this->review_test,$this->view_corect,$this->view_feedback,$this->view_send_result,$list_score[$key], $list_score_in_test_table[$key]);
							$html .= Zend_View_Helper_FormatDate::_tinyMce_get_absolute_path_image("../../../media/images/tinymce","http://".$_SERVER['SERVER_NAME'].BASE_URL."/media/images/tinymce" ,$HTML);
							// End lấy đường dẫn tuyệt đối cho hình ảnh

							//$html  .= '<a class="remove-icon" href="'. BASE_URL .'/question/delete/ajax/1/id/'.trim($list_questionIDItem).'"  onclick="deleteClick(this,this.href); return false;"><img class="fugue fugue-cross"  alt="Xóa"       src="'. BASE_URL .'/img/icons/space.gif"/></a>';
							//$html  .= '<a class="edit-icon"   href="'. BASE_URL .'/question/edit/id/'.trim($list_questionIDItem).'" onclick="editPopup(this.href); return false;"><img class="fugue fugue-pencil" alt="Chỉnh sửa" src="'. BASE_URL .'/img/icons/space.gif"/></a>&nbsp;&nbsp;';
	  						//$html.= Zend_View_Helper_FormatDate::_tinyMce_get_absolute_path_image("../../..","http://".$_SERVER['SERVER_NAME'].BASE_URL,$htmlQues);
					}
			}
			$html .= '<p align="center">============= HẾT =============</p>';
			echo $html;
} ?>
</div>

<script type="text/javascript">
/*
	window.onload = function () {
		a = $("#html-export-doc").html();
		$("#html_submit").val(a);
		$("#export-doc-form").submit();
	}
*/
	$(window).load(function () {
		a = $("#html-export-doc").html();
		$("#html_submit").val(a);
		$("#export-doc-form").submit();
	});
	
	function editPopup(href){
	newwindow=window.open(href,'name','scrollbars=yes,resizable=yes,height=540,width=700', 0);
	if (window.focus) {newwindow.focus()}
}
	
</script>
</form>